package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProvidecontractdetailsMapper;
import com.ruoyi.system.domain.SysProvidecontractdetails;
import com.ruoyi.system.service.ISysProvidecontractdetailsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 供货合同货物Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-12-13
 */
@Service
public class SysProvidecontractdetailsServiceImpl implements ISysProvidecontractdetailsService 
{
    @Autowired
    private SysProvidecontractdetailsMapper sysProvidecontractdetailsMapper;

    /**
     * 查询供货合同货物
     * 
     * @param provideContractDetailsId 供货合同货物ID
     * @return 供货合同货物
     */
    @Override
    public SysProvidecontractdetails selectSysProvidecontractdetailsById(Long provideContractDetailsId)
    {
        return sysProvidecontractdetailsMapper.selectSysProvidecontractdetailsById(provideContractDetailsId);
    }

    /**
     * 查询供货合同货物列表
     * 
     * @param sysProvidecontractdetails 供货合同货物
     * @return 供货合同货物
     */
    @Override
    public List<SysProvidecontractdetails> selectSysProvidecontractdetailsList(SysProvidecontractdetails sysProvidecontractdetails)
    {
        return sysProvidecontractdetailsMapper.selectSysProvidecontractdetailsList(sysProvidecontractdetails);
    }

    /**
     * 新增供货合同货物
     * 
     * @param sysProvidecontractdetails 供货合同货物
     * @return 结果
     */
    @Override
    public int insertSysProvidecontractdetails(SysProvidecontractdetails sysProvidecontractdetails)
    {
        sysProvidecontractdetails.setCreateTime(DateUtils.getNowDate());
        return sysProvidecontractdetailsMapper.insertSysProvidecontractdetails(sysProvidecontractdetails);
    }

    /**
     * 修改供货合同货物
     * 
     * @param sysProvidecontractdetails 供货合同货物
     * @return 结果
     */
    @Override
    public int updateSysProvidecontractdetails(SysProvidecontractdetails sysProvidecontractdetails)
    {
        return sysProvidecontractdetailsMapper.updateSysProvidecontractdetails(sysProvidecontractdetails);
    }

    /**
     * 删除供货合同货物对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysProvidecontractdetailsByIds(String ids)
    {
        return sysProvidecontractdetailsMapper.deleteSysProvidecontractdetailsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除供货合同货物信息
     * 
     * @param provideContractDetailsId 供货合同货物ID
     * @return 结果
     */
    @Override
    public int deleteSysProvidecontractdetailsById(Long provideContractDetailsId)
    {
        return sysProvidecontractdetailsMapper.deleteSysProvidecontractdetailsById(provideContractDetailsId);
    }
}
